page.tsx 544 B

12345678910111213141516171819
  1. import { fetchUserPosts, fetchUserProfile } from '@/lib/api/account/profile';
  2. import UserPostsList from '../_component/UserPostsList';
  3. type Props = {
  4. params: Promise<{ sid: string }>;
  5. };
  6. export default async function UserProfilePostsPage({ params }: Props) {
  7. const { sid } = await params;
  8. const [profileRes, postsRes] = await Promise.all([
  9. fetchUserProfile(sid),
  10. fetchUserPosts(sid, 1, 20)
  11. ]);
  12. const list = postsRes.data?.list ?? [];
  13. const author = profileRes.data ?? null;
  14. return <UserPostsList list={list} author={author} />;
  15. }